;; Copyright (C) 2010 ahei

;; Author: ahei <ahei0802@gmail.com>
;; URL: http://code.google.com/p/dea/source/browse/trunk/my-lisps/session-settings.el
;; Time-stamp: <2010-04-23 19:13:35 Friday by ahei>

;; This  file is free  software; you  can redistribute  it and/or
;; modify it under the terms of the GNU General Public License as
;; published by  the Free Software Foundation;  either version 3,
;; or (at your option) any later version.

;; This file is  distributed in the hope that  it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR  A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You  should have  received a  copy of  the GNU  General Public
;; License along with  GNU Emacs; see the file  COPYING.  If not,
;; write  to  the Free  Software  Foundation,  Inc., 51  Franklin
;; Street, Fifth Floor, Boston, MA 02110-1301, USA.

(require 'my-session)

(defun session-settings ()
  "Settings for `session'."
  (add-hook 'after-init-hook 'session-initialize-with-saveplace)

  (defun session-initialize-with-saveplace ()
    "Call `session-initialize' and add hooks for `saveplace'."
    (session-initialize)
;;;###autoload
    (defun session-settings-4-saveplace ()
      "`session' settings for `saveplace'."
      (add-hook 'find-file-hook 'save-place-find-file-hook t)
      (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)
      (add-hook 'kill-buffer-hook 'save-place-to-alist))

    (eval-after-load "saveplace"
      `(session-settings-4-saveplace))))

(eval-after-load "my-session"
  `(session-settings))

(provide 'session-settings)
